<%--
  Created by IntelliJ IDEA.
  User: 30821
  Date: 2018/7/7
  Time: 21:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>员工管理</title>
    <%@include file="/WEB-INF/views/commons/commons.jsp"%>
    <script type="text/javascript" src="/static/js/system/employee.js"></script>
</head>
<body>
<table id="emp_datagrid"></table>
<div id="tb">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="add()">添加</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="edit()">编辑</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" id="change_btn" onclick="changeState()">停用</a>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true" onclick="reload()">刷新</a>
    <input class="easyui-textbox" name="keyword"id="keyword" prompt="按照名字或电话查询">
    <input class="easyui-textbox" name="departmentName"id="deptName" prompt="请输入部门名称"/>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true" onclick="query()">查询</a>
</div>
<div id="emp_dialog">
    <form id="editForm" method="post">
        <input type="hidden" id="empId" name="id">
        <table style="border-collapse:separate;border-spacing: 10px">
            <tr>
                <td>名字</td>
                <td><input class="easyui-textbox" name="username" prompt="请输入名字" invalidMessage="用户名已存在"
                           validType="remote['/employee/validateUsername?id='+empId.value, 'username']"></td>
            </tr>
            <tr>
                <td>真实名字</td>
                <td><input class="easyui-textbox" name="realname" prompt="请输入名字"/><td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td><input class="easyui-textbox"validType="email" name="email" prompt="请输入有效邮箱"/><td>
            </tr>
            <tr>
                <td>电话</td>
                <td><input class="easyui-textbox" name="tel"/><td>
            </tr>
            <tr>
                <td>部门</td>
                <td><input class="easyui-combobox" name="dept.id"
                           data-options="url:'/department/queryDepts',
                         valueField:'id',textField:'name',panelHeight:'auto'"/></td>
            </tr>
            <tr>
                <td>管理员</td>
                <td><input class="easyui-combobox" name="admin"
                           data-options="data:[{'value':'0', 'text':'平民'}
                                ,{'value':'1', 'text':'管理员'}], valueField:'value',
                                textField:'text',panelHeight:'auto'"/><td>
            </tr>
            <tr>
                <td>入职时间</td>
                <td><input class="easyui-datebox" name="hiredate"/><td>
            </tr>
            <tr>
                <td>角色</td>
                <td><input class="easyui-combobox"name="roles.id" id="rolesId" data-options=
                        "valueField:'id',textField:'name',panelHeight:'auto',
                        url:'/role/queryRoles',multiple:true"/></td>
            </tr>
        </table>
    </form>
</div>

<!--底部按钮-->
<div id="bb">
    <a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="save()">保存</a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="cancel()">关闭</a>
</div>
</body>
</html>
